<?php

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of zipcodemodel
 *
 * @author binhhv
 */
class zipcodemodel extends CI_Model{
    //put your code here
    
    public function getAddress($zipCode){
        $zip='';
        $sql="SELECT * FROM setting_area WHERE zip = $zipCode";
        $query = $this->db->query($sql);
        if ($query->num_rows() > 0) {
            $row = $query->row();
               $zip = (string)$row->setting_area2_id . ','.(string)$row->cityName .  ','.(string)$row->townName;    
        }
        return $zip;
    }
}
